﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using CSF.BusinessCore.Data;

namespace CSF.Products.Data
{
    public enum ProductOptionInputType
    {
        /// <summary>
        /// 无输入
        /// </summary>
        None = 0,
        /// <summary>
        /// 字符串
        /// </summary>
        Text = 1,
        /// <summary>
        /// 长字符串，用一个区域
        /// </summary>
        TextArea = 2,
        /// <summary>
        /// 日期
        /// </summary>
        Date = 3,
        /// <summary>
        /// 列表 （From InputPattern, items seperated by comma）
        /// </summary>
        List = 4,
    }


    public enum ProductOptionType
    {
        /// <summary>
        /// 输入项
        /// </summary>
        InputOnly = 0,
        /// <summary>
        /// 是或否，价格由订购的产品决定
        /// </summary>
        YesOrNo = 1,
        /// <summary>
        /// 是或否，价格由绑定的单个产品决定
        /// </summary>
        YesOrNoProduct = 2,
        /// <summary>
        /// 从绑定的多个产品(或规格)中选择
        /// </summary>
        ChooseProduct = 3
    }

    /// <summary>
    /// Author: Robin
    /// Create Date: 2011-9-9
    /// 产品选项
    /// </summary>
    public class ProductOption : TransactionConfig
    {
        /// <summary>
        /// 产品选项类型
        /// </summary>
        public ProductOptionType OptionType { get; set; }

        /// <summary>
        /// 输入类型
        /// </summary>
        public ProductOptionInputType InputType { get; set; }

        /// <summary>
        /// 输入的内容的规格，以正则表达式表示
        /// 对于列表类型，则是逗号分隔的字符串
        /// </summary>
        public string InputPattern { get; set; }

        /// <summary>
        /// 尺寸依赖的测量参数id
        /// </summary>
        public int SizeMeasureParamId { get; set; }
    }
}
